package com.wlc.exception;

/**
 * @author 王立朝 wanglichao@champion-credit.com
 * @description 测试异常
 * @date 2021-06-29 10:18
 */
public class TestMyException {
    public void method01(int number)  {
        if(number > 10){
            try {
                throw new MyException(number);
            } catch (MyException e) {
                if(number >10){
                    System.out.println("您输入的数字不合法"+ e);
                }
            }
        }
        System.out.println("ok");
    }
    public static void main(String[] args) throws MyException {
        TestMyException testMyException = new TestMyException();
        testMyException.method01(11);
    }

}
